﻿using System;
using System.Collections.Generic;
using System.Collections;
using System.Linq;
using System.Text;
using System.Net;
using System.Threading;
using System.IO;

namespace SDT.CrawlSystem.MediaSrv
{
    public class HttpRequestState
    {
        #region Private Data
        public HttpWebRequest httpRequest;
        public HttpWebResponse httpResponse;
        public Stream httpResponseStream;
        public DataBuffer readBuffer;
        public ArrayList bufferList;
        public ManualResetEvent bufferEvent;
        public Uri getUri;
        public FileStream saveFile;
        public string localSavePath;
        public int readCount;
        public int requestTimeout;
        public int cID;
        public int pID;
        public int uID;
        public MDWorkUnit WorkUnit;
        public string pFile;
        public string CreateDate;

        #endregion
        #region Constructor
        public HttpRequestState(HttpWebRequest httpObj, ArrayList list, ManualResetEvent dataEvent)
        {
            httpRequest = httpObj;
            httpResponse = null;
            httpResponseStream = null;
            bufferList = list;
            bufferEvent = dataEvent;
            readBuffer = new DataBuffer();
            readCount = 0;

        }

        public HttpRequestState(HttpWebRequest httpObj, ArrayList list, ManualResetEvent dataEvent, MDWorkUnit workUnit)
        {
            httpRequest = httpObj;
            httpResponse = null;
            httpResponseStream = null;
            bufferList = list;
            bufferEvent = dataEvent;
            readBuffer = new DataBuffer();
            readCount = 0;
            WorkUnit = workUnit;

        }
        #endregion
    }

}
